<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>#{userCalendarBean.selectedUserName} #{userCalendarBean.selectedUserSurname} Calendar</title>
        <h:outputStylesheet library="css" name="stylesheet.css" />
    </h:head>
    <h:body>
        <header>
            <h1 id="title">MeteoCal</h1>
            <h:form id="searchForm" class="float-left">
                <p:inputText value="#{searchBean.searchInput}" id="keyword" maxlength="200"/>
                <p:commandButton class="searchUsersButton" action="#{searchBean.findUser()}" icon="ui-icon-search"/>
                <p:watermark for="keyword" value="Search..." id="watermark" />
            </h:form>
            <ul id="landmarks">
                <li><p:link outcome="user/home" value="#{homeBean.name}'s Calendar"/></li>
                <li><p:link outcome="user/notifications" value="Notifications (#{notificationBean.getNumberOfNotifies()})"/></li>
                <li><p:link outcome="user/addressbook" value="Addressbook"/></li>
                <li><p:link outcome="user/settings" value="Settings"/></li>
                <li><h:form><p:commandLink action="#{indexBean.logout()}" value="Logout"/></h:form></li>
            </ul>
        </header>
        <section>
            <div style="width:1024px;margin:auto;margin-bottom:50px;">
                <h:form style="padding-bottom: 10px;">
                    <p:commandButton 
                        action="#{userCalendarBean.addContact()}"
                        value="Add To Contacts" disabled="#{userCalendarBean.contactExist()}"/>
                    <p:outputLabel style="margin:0px;padding:20px;font-size:14px;"
                        value="#{userCalendarBean.selectedUserName} #{userCalendarBean.selectedUserSurname} (#{userCalendarBean.selectedUserEmail})"/>
                </h:form>


                <h:form id="scheduleform">
                    <p:schedule id="schedule" value="#{userCalendarScheduleBean.scheduleModel}" widgetVar="myschedule"
                                draggable="false" resizable="false" axisFormat="H(:mm)" timeFormat="H(:mm)"
                                firstHour="0" showWeekends="true">


                        <p:ajax event="eventSelect" listener="#{userCalendarScheduleBean.onEventSelect}"
                                update="eventDetails" oncomplete="PF('eventDialog').show();" />

                    </p:schedule>

                    <p:dialog widgetVar="eventDialog" header="Event Details"
                              showEffect="clip" hideEffect="clip"  style="font-size: 15px;">
                        <h:panelGrid id="eventDetails" columns="2">

                            <p:outputLabel value="Name:"/>
                            <p:outputLabel value="#{userCalendarScheduleBean.currentEvent.name}"/>

                            <p:outputLabel value="Description"/>
                            <p:outputLabel value="#{userCalendarScheduleBean.currentEvent.description}"/>

                            <p:outputLabel value="Start Time:"/>
                            <p:outputLabel value="#{userCalendarScheduleBean.currentEvent.beginTime}"/>

                            <p:outputLabel value="End Time:"/>
                            <p:outputLabel value="#{userCalendarScheduleBean.currentEvent.endTime}"/>

                            <p:outputLabel value="Location:"/>
                            <p:outputLabel value="#{userCalendarScheduleBean.currentEvent.location}"/>

                            <p:commandButton id="goButton" value="Go to Event Page"
                                             action="/event?faces-redirect=true"
                                             disabled="#{userCalendarScheduleBean.isPrivate()}"/>
                        </h:panelGrid>
                    </p:dialog>
                </h:form>
            </div>
        </section>
    </h:body>
</html>
